<template>
  <div class="introduceBox">
    <div class="imgBox">
      <img :src="detailObj.coverImgUrl" alt="" />
    </div>
    <div class="introduceBoxRight">
      <div class="songSheetName" :title="detailObj.name">
        {{ detailObj.name }}
      </div>
      <p class="trackUpdateTime">
        最近更新：{{ detailObj.trackUpdateTime | fmtDate("MM月DD日") }}
        <span>(每天更新)</span>
      </p>
      <div class="btnBox">
        <div class="playBtn" @click="songSheetPlay(detailObj.tracks)">
          <i></i>
          <span> 播放 </span>
        </div>
        <div class="addSongSheet" @click="addMusicList(detailObj.tracks)"></div>
        <div class="btnClass">
          <i>({{ detailObj.subscribedCount }})</i>
        </div>
        <div class="btnClass forward">
          <i>({{ detailObj.shareCount }})</i>
        </div>
        <div class="btnClass download">
          <i>下载</i>
        </div>
        <div class="btnClass comment">
          <i>{{ detailObj.commentCount }}</i>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapActions } from "vuex";
export default {
  props: {
    detailObj: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      isOPen: false,
    };
  },
  methods: {
    ...mapActions("musicStore", ["songSheetPlay", "addMusicList"]),
  },
};
</script>

<style lang="scss" scoped>
.introduceBox {
  width: 100%;
  padding: 40px 0;
  box-sizing: border-box;
  display: flex;
  .imgBox {
    width: 150px;
    height: 150px;
    padding: 2px;
    border: 1px solid #ccc;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .introduceBoxRight {
    flex: 1;
    overflow: hidden;
    margin-left: 30px;
    .songSheetName {
      margin: 16px 0 4px;
      line-height: 24px;
      font-size: 20px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .trackUpdateTime {
      color: #666;
      margin: 0 0 20px;
      line-height: 35px;
      span {
        color: #999;
        margin-left: 5px;
      }
    }
    .btnBox {
      .playBtn {
        background: url("./../../assets/imges/backgroundStripe.png") no-repeat 0 -387px;
        padding: 0 5px 0 0;
        height: 31px;
        display: inline-block;
        color: #fff;
        vertical-align: middle;
        cursor: pointer;
        i {
          background: url("./../../assets/imges/backgroundStripe.png") no-repeat
            0 -1622px;
          width: 20px;
          height: 18px;
          margin: 6px 2px 2px 5px;
          display: inline-block;
          vertical-align: middle;
        }
        span {
          vertical-align: middle;
        }
      }
      .addSongSheet {
        margin-right: 5px;
        line-height: 30px;
        width: 31px;
        display: inline-block;
        height: 31px;
        vertical-align: middle;
        background: url("./../../assets/imges/backgroundStripe.png") no-repeat 0 -1588px;
      }
      .btnClass {
        color: #333;
        background: url("./../../assets/imges/backgroundStripe.png") no-repeat
          right -1020px;
        padding: 0 5px 0 0;
        white-space: nowrap;
        display: inline-block;
        vertical-align: middle;
        margin-right: 5px;
        i {
          padding-right: 2px;
          padding-left: 28px;
          height: 31px;
          line-height: 30px;
          display: inline-block;
          min-width: 23px;
          background: url("./../../assets/imges/backgroundStripe.png") no-repeat
            0 -977px;
          cursor: pointer;
        }
      }
      .forward {
        i {
          background: url("./../../assets/imges/backgroundStripe.png") no-repeat
            0 -1225px;
        }
      }
      .download {
        i {
          background: url("./../../assets/imges/backgroundStripe.png") no-repeat
            0 -2761px;
        }
      }
      .comment {
        i {
          background: url("./../../assets/imges/backgroundStripe.png") no-repeat
            0 -1465px;
        }
      }
    }
  }
}
</style>